
import React from 'react'
import { Outlet, Navigate, useLocation } from 'react-router-dom';
import Header from '@/components/Header/Header'
import UserAvatar from '@/components/UserAvatar'
const Template = () => {
  const location = useLocation();
  // 进入/template自动跳转到/template/all
  if (location.pathname === '/template') {
    return <Navigate to="/template/all" replace />;
  }
  return (
    <div>
      <Header></Header>
      <Outlet />
      <UserAvatar></UserAvatar>
    </div>
  )
}

export default Template
